package org.x.casemodule.enums;

public enum ReminderStatusEnum {


    //'PENDING','SENT','FAILED'
    PENDING("PENDING", "待发送"),
    SENT("SENT", "已发送"),
    FAILED("FAILED", "发送失败");
    private String code;
    private String name;
    ReminderStatusEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static ReminderStatusEnum getByCode(String code) {
        for (ReminderStatusEnum value : ReminderStatusEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public static ReminderStatusEnum getByName(String name) {
        for (ReminderStatusEnum value : ReminderStatusEnum.values()) {
            if (value.getName().equals(name)) {
                return value;
            }
        }
        return null;
    }

}
